/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';
import { batchDelete } from '../../shop/car/shopCar';

const { ctxPath, adminPath } = useGlobSetting();

export interface WecharCusInvPriceRoute extends BasicModel<WecharCusInvPriceRoute> {
  cusCode?: string; // 客户编码
  invCode?: string; // 存货编码
  fprice?: number; // 单价
  caccId?: string; // 协同账套
}

export const wecharCusInvPriceRouteList = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/list',
    params,
  });

export const wecharCusInvPriceRouteListData = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.post<Page<WecharCusInvPriceRoute>>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/listData',
    params,
  });

export const wecharCusInvPriceRouteForm = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/form',
    params,
  });

export const wecharCusInvPriceRouteSave = (params?: any, data?: WecharCusInvPriceRoute | any) =>
  defHttp.postJson<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/save',
    params,
    data,
  });

export const wecharCusInvPriceRouteImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/setting/price/wecharCusInvPriceRoute/importData',
      onUploadProgress,
    },
    params,
  );

export const wecharCusInvPriceRouteDelete = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/delete',
    params,
  });

export const valid = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/valid',
    params,
  });

export const updateCheck = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/check',
    params,
  });

export const treeData = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/treeData',
    params,
  });

export const listEndCusData = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/listEndCusData',
    params,
  });

export const listEndCusInvData = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/listEndCusInvData',
    params,
  });

export const listCusInvPriceRouteValidData = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRouteValid/listData',
    params,
  });

export const listCusInvPriceRouteValidDelete = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRouteValid/delete',
    params,
  });

export const batchDeletePrice = (params?: WecharCusInvPriceRoute | any) =>
  defHttp.get<WecharCusInvPriceRoute>({
    url: adminPath + '/setting/price/wecharCusInvPriceRoute/batchDelete',
    params,
  });
